#pragma once

#include <QThread>
#include <QSharedPointer>
#include "GatherFactory.h"
#include "DataGatherHRF9828.h"
#include "Config.h"
#include <QMutex>
#include <QVector>

class GatherThread : public QThread
{
    Q_OBJECT

public:    
    GatherThread();

    void startGather();
    void stopGather();    
        
    void setParam(Param_HRF9828 p);
    Param_HRF9828 param();
    
signals:
    void sigData(QByteArray data);
    void sigError(QString error);

protected:
    virtual void run() override;
    void sendData();
    void sendVolt();
    void sendClose();    

    bool isRun;
    QMutex m_mutex;
    Param_HRF9828 m_param;
    uint ftHandle;
    std::unique_ptr<DataGatherHRF9828> m_gather;    
};